From 9cbe72b100b3f90f32b6f6863a464f9e8b5f8ccb Mon Sep 17 00:00:00 2001 From: tsteven4 <13596209+tsteven4@users.noreply.github.com> Date: Fri, 7 Aug 2020 07:38:47 -0600 Subject: [PATCH] use Qt endian detetion. (#619) This frees us from AC_C_BIGENDIAN which conditionally defined WORDS_BIGENDIAN. The defintion of WORDS_BIGENDIAN was and is not handled by GPSBabel.pro. --- util.cc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/util.cc b/util.cc index 4e622fc51..448f64e3e 100644 --- a/util.cc +++ b/util.cc @@ -53,16 +53,12 @@ #include "src/core/logging.h" // for Warning #include "src/core/xmltag.h" // for xml_tag, xml_attribute, xml_findfirst, xml_findnext -// First test Apple's clever macro that's really a runtime test so -// that our universal binaries work right. -#if defined __BIG_ENDIAN__ -#define i_am_little_endian !__BIG_ENDIAN__ -#else -#if defined WORDS_BIGENDIAN +#if Q_BYTE_ORDER == Q_BIG_ENDIAN # define i_am_little_endian 0 -#else +#elif Q_BYTE_ORDER == Q_LITTLE_ENDIAN # define i_am_little_endian 1 -#endif +#else +# error Unhandled Endianness #endif void* -- 2.30.2